package tk.xboot.flink.cep.mc.events;



public abstract class MonitoringEvent {

    private int rackId;

    public MonitoringEvent(int rackId) {
        this.rackId = rackId;
    }

    public int getRackId() {
        return rackId;
    }

    public void setRackId(int rackId) {
        this.rackId = rackId;
    }

    @Override
    public int hashCode() {
        return rackId;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof MonitoringEvent) {
            MonitoringEvent monitoringEvent = (MonitoringEvent) obj;
            return monitoringEvent.canEquals(this) && rackId == monitoringEvent.rackId;
        }else{
            return false;
        }
    }

    public boolean canEquals(Object object) {
        return object instanceof MonitoringEvent;
    }
}
